<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>尺寸</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        div {
            margin: 100px;
            padding: 100px;
            border: 10px solid #abcdef;
        }
    </style>
    <script src="./res/jquery-3.5.1.min.js"></script>
</head>

<body>

    <div>
        <img src="./img/img_jquerydim.png.gif" alt="">
    </div>
    <!-- 
        width = element
        innerWidth = element + padding
        outerWidth = element + padding + border
        outerWidth(true)= element + padding + border + margin
    -->
</body>

</html>
<script>
    $(function(e) {
        window.console.log('width = ' + $('div').width());
        window.console.log('innerWidth = ' + $('div').innerWidth());
        window.console.log('outerWidth = ' + $('div').outerWidth());
        window.console.log('outerWidth(true) = ' + $('div').outerWidth(true));
    });
</script>